package cn.spike.rockcc.exception;

import cn.spike.rockcc.errorenum.GlobalExceptionCode;

/**
 * @author:spike
 * @create:2023-03-08 12:33
 */

public class BusinessException extends RuntimeException{

    private String message;
    private String code;

    public BusinessException() {
    }

    public BusinessException(String message) {
        this.message = message;
    }

    public BusinessException(String message, String code) {
        this.message = message;
        this.code = code;
    }
    public BusinessException(GlobalExceptionCode globalExceptionCode) {
        this.message = globalExceptionCode.getMessage();
        this.code = globalExceptionCode.getCode();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }


}
